package com.woniuxy.amusementparkos.exception.lzw;

import com.woniuxy.amusementparkos.exception.lzw.unifyhanding.code.PublicCode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @author lizhiwen
 * @create 2020-04-30 12:20 上午
 */
@Getter
@NoArgsConstructor
public class KnownException extends RuntimeException{

    /**
     * 在异常返回值里，加入自定义内容
     */
    private PublicCode publicCode;

    public KnownException(PublicCode publicCode){
        super(publicCode.getCode()+" : "+publicCode.getMessage());
        this.publicCode = publicCode;
    }

}
